// remap jQuery to $
(function($){})(window.jQuery);


/* trigger when page is ready */
$(document).ready(function (){
  $('.dropdown-toggle').dropdown();
	$(".stripeMe tr:even").addClass("alt");
        
	// Toggle the dropdown menu's
	$(".dropdown .button").click(function () {
		$(this).parent().find('.dropdown-slider').slideToggle('fast');
		$(this).find('span.toggle').toggleClass('active');
		return false;
	});
});

$(document).ready(function() {
    $("#dialog").dialog({
      autoOpen: false,
      modal: true,
	    resizable: false,
	    draggable: false
    });
	
    // $( ".infoMessage" ).dialog({
    //   modal: true,
    //   buttons: {
    //     Ok: function() {
    //       $( this ).dialog( "close" );
    //     }
    //   }
    // });

    $( "#helpMessage" ).dialog({
      autoOpen: false,
      modal: true,
      buttons: {
        Ok: function() {
          $( this ).dialog( "close" );
        }
      }
    });

  $("#helplink").click(function() {
    $("#helpMessage").dialog("open");
  });


	// bind "click" event for links with title="submit" 
    $("a[title=submit]").click( function(e){
    // it submits the form it is contained within
	e.preventDefault();
    $(this).parents("form").submit();

  });

  $(".negative").click(function(e) {
    e.preventDefault();
    var targetUrl = $(this).attr("href");

    $("#dialog").dialog({
      buttons : {
        "Confirm" : function() {
          window.location.href = targetUrl;
        },
        "Cancel" : function() {
          $(this).dialog("close");
        }
      }
    });

    $("#dialog").dialog("open");
  });
  });

// Close open dropdown slider/s by clicking elsewhwere on page
$(document).bind('click', function (e) {
	if (e.target.id != $('.dropdown').attr('class')) {
		$('.dropdown-slider').slideUp();
		$('span.toggle').removeClass('active');
	}
}); // END document.bind

$(window).load(function() {

});

$(window).resize(function() {

});




              
